package foodhelper.healthtip;

import java.util.ArrayList;

import foodhelper.database.Database;
import foodhelper.model.Tip;
import foodhelper.mtech.com.MainActivity;
import foodhelper.mtech.com.R;
import foodhelper.mtech.com.R.layout;
import foodhelper.mtech.com.R.menu;
import android.os.Bundle;
import android.app.Activity;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import android.view.Menu;
import android.widget.ListView;

public class HealthTip extends Activity {
	
	private ListView asianLV;
	private ArrayList<Tip> listTip;
	private MyArrayAdapter adapter;
	private MainActivity main;
	private Cursor myCur; 
	//private SQLiteDatabase tipDatabase = main.getDb();	
	private Tip mtip;
	public Database mdb;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.health_tip);
		mdb = Database.getInstance(this);
		listTip=mdb.getListTIPS();
		
			adapter = new MyArrayAdapter(this, R.layout.tip_listview_custom, listTip);
			
			asianLV.setAdapter(adapter);
			myCur.close();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.health_tip, menu);
		return true;
	}

}
